<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<%@ include file="/WEB-INF/views/include/easyui.jsp"%>
<script src="${ctx}/static/plugins/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<script src="${ctx}/static/plugins/easyui/common/index.js" type="text/javascript"></script>

</head>
<body class="easyui-layout" style="font-family: '微软雅黑'">
	<div data-options="region:'center',split:true,border:false,title:'对账历史列表'">
		<div id="tb" style="padding:5px;height:auto">
				<div>
					<form id="searchFrom" action="">
						<input type="text" name="filter_EQS_orderSn" class="easyui-validatebox" data-options="width:300,prompt: '订单号'"/>
						<span class="toolbar-item dialog-tool-separator"></span>
						<a href="javascript(0)" class="easyui-linkbutton" plain="true" iconCls="icon-search" onclick="cx()">查询</a>
					</form>
				</div>
		</div>
		<table id="dg"></table>
	</div>


<div id="dlg"></div>  
<script type="text/javascript">
var dg;
$(function(){   
	dg=$('#dg').datagrid({    
	method: "get",
	url:'${ctx}/business/accountstatement/json',
    fit : true,
	fitColumns : true,
	border : false,
	striped:true,
	idField : 'id',
	pagination:true,
	rownumbers:true,
	pageNumber:1,
	pageSize : 20,
	pageList : [ 10, 20, 30, 40, 50 ],
	singleSelect:true,
    columns:[[    
		{field:'ashId',title:'id', hidden: true},
		{field:'asDay',title:'对账日',width:100},
		{field:'addTime',title:'创建时间',width:100},
		{field:'_opt', title:'操作', width:80,
			formatter: function(value, rec) {
				var sellerId = rec.sellerId;
				return '<a href="#" onclick="' + 'openDialog(' + rec.asDay + ')">操作</a>';
			}
		}

    ]],
    enableHeaderClickMenu: false,
    enableHeaderContextMenu: false,
    enableRowContextMenu: false,
    toolbar:'#tb'
});
});

function openDialog(asDay) {
	parent.mainpage.mainTabs.addModule('对账信息','${ctx}/business/accountstatement/asdetailoneday/'+asDay, 'icon-hamburg-settings')
}

//创建查询对象并查询
function cx(){
	var obj=$("#searchFrom").serializeObject();
	dg.datagrid('reload',obj); 
}

function audit() {
	var row = dg.datagrid('getSelected');
	if(rowIsNull(row)) return;
	parent.$.messager.confirm('提示', '是否通过审核？', function(data){
		if (data){
			// alert(data);
			$.ajax({
				type:'post',
				url:"${ctx}/business/seller/auditSeller/" + row.sellerId,
				success: function(data){
					successTip(data,dg);
				}
			});
		}
	});
}

function auditNopass() {
	var row = dg.datagrid('getSelected');
	if(rowIsNull(row)) return;
	parent.$.messager.confirm('提示', '是否不通过审核？', function(data){
		if (data){
			// alert(data);
			$.ajax({
				type:'post',
				url:"${ctx}/business/seller/auditNopassSeller/" + row.sellerId,
				success: function(data){
					successTip(data,dg);
				}
			});
		}
	});
}

</script>
</body>
</html>